package edu.yctc.delivery.dao;

import org.apache.ibatis.annotations.Mapper;

import edu.yctc.delivery.entity.UserDO;

/**
 *
 * UserDAO接口
 * 
 * @author 渠立庆
 */
@Mapper
public interface UserDAO {

    /**
     * 插入
     * 
     * @param userDO
     */
    public void insert(UserDO userDO);

    /**
     * 通过Id删除
     * 
     * 
     * @param id
     */
    public void deleteById(long id);

    /**
     * 更新
     * 
     * @param userDO
     */
    public void update(UserDO userDO);

    /**
     * 
     * 通过id得到UserDO
     * 
     * @param id
     * @return
     */
    public UserDO getUserDOById(long id);

    /**
     * 
     * 通过account和password获得UserDO
     * 
     * @param account
     * @param password
     * @return
     */
    public UserDO getUserDOByAccountAndPassword(String account, String password);

    /**
     * 通过email和password获得UserDO
     * 
     * 
     * @param email
     * @param password
     * @return
     */
    public UserDO getUserDOByEmailAndPassword(String email, String password);

    /**
     * 通过电话和密码获得UserDO
     * 
     * 
     * @param phone
     * @param password
     * @return
     */
    public UserDO getUserDOByPhoneAndPassword(String phone, String password);

    /**
     * 通过email来获得UserDO
     * 
     * 
     * @param email
     * @return
     */
    public UserDO getUserDOByEmail(String email);

    /**
     * 通过phone来获取UserDO
     * 
     * @param phone
     * @return
     */
    public UserDO getUserDOByPhone(String phone);

    /**
     * 通过account获取UserDO
     * 
     * @param account
     * @return
     */
    public UserDO getUserDOByAccount(String account);

    /**
     * 通过name获取UserDO
     * 
     * @param account
     * @return
     */
    public UserDO getUserDOByName(String name);

}
